package lab02.test19;

public class Test19 {
    public static void main(String[] args) {
        String str = "GOODmorning";

        //字符串转换为字符数组
        char[] chars = str.toCharArray();
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0; i < chars.length; i++) {

            //将大小写字母转换
            if (chars[i] >= 'A' && chars[i] <= 'Z') {
                stringBuffer.append(String.valueOf(chars[i]).toLowerCase());
            } else if (chars[i] >= 'a' && chars[i] <= 'z') {
                stringBuffer.append(String.valueOf(chars[i]).toUpperCase());
            }
        }

        //反序输出
        String result = stringBuffer.reverse().toString();
        System.out.println(result);
    }
}
